package ch6;

import java.util.Scanner;

public class ArrAvg {

	public static void main(String[] args) {
		int[] a1 = new int[10];
		Scanner in = new Scanner(System.in);
		System.out.println("输入" + a1.length + "个整数：");
		for (int i = 0; i < a1.length; i++) {
			a1[i] = in.nextInt();
		}
		int sum = 0;
		for (int i = 0; i < a1.length; i++) {
			System.out.print(a1[i] + " ");
			sum += a1[i];
		}
		int avg = sum / a1.length;
		System.out.println(" 平均值是：" + avg);

	}

}
